package com.zhiyou100.service;

import com.zhiyou100.mapper.OrderMapper;
import com.zhiyou100.model.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class OrderService {
    @Autowired
    OrderMapper orderMapper;
    public List<Order> listOrder(Map map) {
        List<Order> Order =  orderMapper.listOrder(map);
        return Order;

    }

    public int addOrder(Order Order) {
       int  i  =  orderMapper.addOrder(Order);
       return i;
    }

    public int updateOrder(Order Order) {
        int  i  =  orderMapper.updateOrder(Order);
        return i;
    }

    public Order lookOrder(int id) {
        Order Order =  orderMapper.lookOrder(id);
        return Order;
    }

    public int deleteAll(List<Integer> OrderIds) {
      int i =   orderMapper.deleteAll(OrderIds);
      return i;
    }

    public int delete(int id) {
       int i =  orderMapper.delete(id);
       return  i;
    }

    public int updateOrderEndTime(int id, String endTime) {
        int i =  orderMapper.updateOrderEndTime( id,  endTime);
        return  i;
    }
}
